package com.bwf.lgqingdan.gui.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.bwf.lgqingdan.R;
import com.bwf.lgqingdan.gui.adapter.base.BaseRecycleViewAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/11/20.
 */

public class SearchHistoryAdapter extends BaseRecycleViewAdapter<String> {
    public SearchHistoryAdapter(Context context) {
        super(context);
    }

    @Override
    protected int getHeaderItemCount() {
        return 0;
    }

    @Override
    protected int getFooterItemCount() {
        return 0;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflaterView(R.layout.list_item_search_history, parent);
        return new ItemViewHolder(view);
    }

    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        ItemViewHolder viewHolder = (ItemViewHolder) holder;
        viewHolder.textViewSearchHistoryItem.setText(getItem(position));
    }

     class ItemViewHolder extends BaseViewHolder{
        @BindView(R.id.textView_search_history_item)
        TextView textViewSearchHistoryItem;

         ItemViewHolder(View view) {
             super(view);
            ButterKnife.bind(this, view);
        }
    }
}
